package main

import (
	_ "demo3/routers/server"
	_ "demo3/routers/web"
	"fmt"
	"github.com/astaxie/beego"
	"os"
)

func main() {
	mainInit()
	beego.Run()
}

func mainInit() {
	//增加一个静态资源目录
	beego.SetStaticPath("/down1", "down1")

	//拿到当前环境
	env := os.Getenv("ENV_GO")

	var configPath string = "./conf/environments/dev.conf"
	if env == "dev" {
		configPath = "./conf/environments/dev.conf"
	}

	err := beego.LoadAppConfig("ini", configPath)
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println("环境变量：", env)
}
